package thread;

public class ThreadDemo1 {
    public static void main(String[] args) {
        //1.实例化两个线程
        MyThread1 t1 = new MyThread1();
        MyThread2 t2 = new MyThread2();

        //2.调用线程启动的start()方法
        t1.start();
        t2.start();
    }
}

class MyThread1 extends Thread {
    public void run() {
        for (int i = 0; i < 100; i++) {
            System.out.println("你是谁啊!");
        }
    }
}

class MyThread2 extends Thread {
    public void run() {
        for (int i = 0; i < 100; i++) {
            System.out.println("开门，我是查水表的!");
        }
    }
}
